package Box2D.Common.Math
{
	import Box2D.Common.b2Wrapper;
	
	public class b2Sweep extends b2Wrapper
	{
		private var _localCenter:b2Vec2;
		private var _c0:b2Vec2;
		private var _c:b2Vec2;		
		public function b2Sweep(wrapper:Object=null)
		{
			if(wrapper==null)
				wrapper = callDirect('b2Sweep_new');
			super(wrapper);
			_localCenter = new b2Vec2(0,0,wrapper);
			_c0 = new b2Vec2(0,0,wrapper+8);
			_c = new b2Vec2(0,0,wrapper+16);
		}
		/// Get the interpolated transform at a specific time.
		/// @param beta is a factor in [0,1], where 0 indicates alpha0.
		public function GetTransform(xf:b2Transform, beta:Number):void{
			call('b2Sweep_GetTransform',xf.wrapper,beta)
		}
		
		/// Advance the sweep forward, yielding a new initial state.
		/// @param alpha the new initial time.
		public function Advance(alpha:Number):void{
			call('b2Sweep_Advance',alpha)	
		}
		
		/// Normalize the angles.
		public function Normalize():void{
			call('b2Sweep_Normalize')
		}
		
		public function Copy(source:b2Sweep):void{
			call('b2Sweep_Copy',source.wrapper);
		}
		
		public function get localCenter():b2Vec2{return _localCenter}
		public function set localCenter(value:b2Vec2):void{_localCenter.Copy(value)}
		
		public function get c0():b2Vec2{return _c0}
		public function set c0(value:b2Vec2):void{_c0.Copy(value)}
		
		public function get c():b2Vec2{return _c}
		public function set c(value:b2Vec2):void{_c.Copy(value)}
		
		public function get a0():Number{return getNumber(24)}
		public function set a0(value:Number):void{setNumber(24,value)}
		
		public function get a():Number{return getNumber(28)}
		public function set a(value:Number):void{setNumber(28,value)}
		
		public function get alpha0():Number{return getNumber(32)}
		public function set alpha0(value:Number):void{setNumber(32,value)}
	}
}